<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<!--<meta name="format-detection" content="telephone=no">-->
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
		<meta name="description" content="">
		<meta http-equiv="x-dns-prefetch-control" content="on">
		<title>PDF显示</title>
		<style>
			body {
				margin: 0px;
				padding: 0px;
			}
			iframe {
				width: 100%;
				height: 100%;
				border: 0px;
				overflow: scroll;
			}
			.btn-top {
				position: absolute;
				height: 32px;
				line-height: 32px;
				background-color: rgba(127, 127, 127, 1);
				width: 100%;
				z-index: 9;
				top: 0;
				left: 0;
			}
		</style>
	</head>

	<body>
		<iframe src="document/jxyb.pdf"></iframe>
		<div class="btn-top">关闭按钮</div>
	</body>
	<script>
		var _vh = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;

		function $() {
				return document.querySelector(arguments[0]);
			}
			/**
			 * 获取地址栏参数值
			 * @param {Object} p
			 */

		function getURLParam(p) {
			var href = window.location.href,
				s = window.location.search.substr(1),
				reg = new RegExp(p + "=([^&]*)"),
				sp = '?',
				ps = s.match(reg);
			if (ps != null) { // 说明该参数存在
				return ps[1];
			} else {
				return null;
			}
		}
		$('body').style.height = _vh + 'px';
		$('iframe').src = getURLParam('pdf');
		$('.btn-top').ontouchend = function() {
			alert('测试');
			window.opener=null;
			window.close();
		}
	</script>

</html>